<?php
/**
 * Created by PhpStorm.
 * User: XP
 * Date: 2017/10/29
 * Time: 13:31
 */
namespace app\index\controller;
use \think\Session;
class Sta extends \think\Controller{
    public function index(){

    }
    //显示工作人员界面
    public function staff(){
        $level=Session::get('user');
        if(!empty($level)){
            $this->assign('username',$level->name);
            $this->assign('userlevel',$level->level);
            if ($level->getLevel() == 0) {
                $this->redirect('/index/Adm/admin');
            } else if($level->getLevel() == 1){
                return $this->fetch();

            }else{
                $this->redirect('/index/Pre/preview');
            }
        }else{
            $this->redirect('/');
        }
    }
    public function userExit(){
        Session::clear();
        return Session::has('user');
    }
    //显示图书管理界面
    public function manageMonograph(){
        return view('manageMonograph');
    }
}